package com.github.thinwonton.spring.source.analysis;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;

import java.util.Properties;

public class DynamicPropertiesConfigurer extends PropertyPlaceholderConfigurer {

//    private ZookeeperUtil zookeeperUtil;
//
//    public void setZookeeperUtil(ZookeeperUtil zookeeperUtil) {
//        this.zookeeperUtil = zookeeperUtil;
//    }


    public DynamicPropertiesConfigurer() {
        System.out.println("=========构造方法===========");
    }

    @Override
    protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) throws BeansException {
//        System.out.println("-----------------" + zookeeperUtil.getAddr());

        System.out.println("========= processProperties ===========");

        super.processProperties(beanFactoryToProcess, props);
    }
}
